package com.java.io.file;

import java.io.File;
import java.io.IOException;

public class CreateFolder {

	/**
	 * 创建一个文件夹
	 */
	public static void main(String[] args) {
		try {
			String folderPath = "D:" +  File.separator + "fileTest";
			String filePath = folderPath + File.separator + "fileTest.txt";
			File folder = new File(folderPath);
			if(folder.exists()){
				System.out.println("文件夹已经存在！");
			} else {
				folder.mkdir();
			}
			File file = new File(filePath);
			file.createNewFile();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
